Skip to content

cuda.core: add graph definition node updates#2395

Draft
Andy-Jost wants to merge 6 commits into
NVIDIA:mainfrom
Andy-Jost:graph-definition-node-updates
Draft

cuda.core: add graph definition node updates#2395
Andy-Jost wants to merge 6 commits into
NVIDIA:mainfrom
Andy-Jost:graph-definition-node-updates

Conversation

@Andy-Jost

Copy link
Copy Markdown
Contributor

Summary

Add atomic parameter mutation for graph definition nodes, starting with event-record nodes. This draft establishes the shared generic-setter and attachment transaction path that the remaining node types will use.

This branch is stacked on #2357 for early CI coverage and will be rebased onto main after that PR merges.

Changes

  • Add a shared definition-node parameter update helper using cuGraphNodeSetParams.
  • Add EventRecordNode.update() with failure-atomic attachment replacement and cached-state commit.
  • Add parameterized node-update tests designed to extend across definition and executable updates.

Test Coverage

  • Full cuda-core graph test suite on ipp1-1093.
  • pre-commit run --all-files.

Related Work

@Andy-Jost Andy-Jost added this to the cuda.core 1.2.0 milestone Jul 20, 2026
@Andy-Jost Andy-Jost added P0 High priority - Must do! feature New feature or request cuda.core Everything related to the cuda.core module labels Jul 20, 2026
@Andy-Jost Andy-Jost self-assigned this Jul 20, 2026
@copy-pr-bot

copy-pr-bot Bot commented Jul 20, 2026

Copy link
Copy Markdown
Contributor

Auto-sync is disabled for draft pull requests in this repository. Workflows must be run manually.

Contributors can view more details about this message here.

@Andy-Jost

Copy link
Copy Markdown
Contributor Author

/ok to test

@github-actions

Copy link
Copy Markdown

Use the generic node setter with failure-atomic attachment replacement, establishing the shared path for definition-level parameter mutation.
Extend definition-level mutation to event waits and both Python and ctypes host callbacks while preserving old executable state and attachment ownership.
Report unsupported driver or binding versions before preparing mutation attachments or calling the generic node setter.
@Andy-Jost
Andy-Jost force-pushed the graph-definition-node-updates branch from 4ce2862 to fffa9fd Compare July 22, 2026 23:04
Allow partial memset parameter replacement while preserving graph-owned destination lifetimes and previously instantiated graph behavior.
Support partial copy parameter replacement while preserving independent source and destination ownership across graph instantiations.

@mdboom mdboom left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The general organization and approach looks fine to me.

One small suggestion (that I can't really evaluate because I don't deeply understand the use cases).

Comment on lines +388 to +397
def update(
self,
dst: Buffer | int | None = None,
value=None,
width: int | None = None,
height: int | None = None,
pitch: int | None = None,
*,
dst_owner=None,
) -> None:

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

One minor point (which really hinges on how we expect these update methods to be used).

If the idea is that users will most often be updating a subset of these values, it might be clearer to make them all kwarg only (i.e. put the *, at the beginning).

It's a minor point, but something we won't be able to change after the API freezes.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

cuda.core Everything related to the cuda.core module feature New feature or request P0 High priority - Must do!

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants